﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DeveloperSite.Master" AutoEventWireup="true" CodeBehind="NewCall.aspx.cs" Inherits="Amkeni_System.CO.Edit.NewCall" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=Amkeni_DatabaseEntities" 
        DefaultContainerName="Amkeni_DatabaseEntities" EnableDelete="True" EnableFlattening="False" 
        EnableInsert="True" EnableUpdate="True" EntitySetName="RFPs">
    </asp:EntityDataSource>

    <div style="height:2em;">
        <div style="float:left;">
            <asp:Label ID="ContextLabel" runat="server" Text="ADD A NEW CALL INTO THE DATABASE" CssClass="ContentHead"></asp:Label>
        </div>
    </div>

    <asp:Table ID="Table1" runat="server">
        <asp:TableRow>
            <asp:TableCell style="padding-top:1em;">
                <asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
            </asp:TableCell>
            <asp:TableCell style="padding-top:1em;">
                <asp:TextBox ID="CallNameTxBx" runat="server" CssClass="MText"></asp:TextBox>
                <br />
                <asp:RequiredFieldValidator ID="R1" runat="server" ErrorMessage="Suggest a name for this call above" 
                    ForeColor="Red" ControlToValidate="CallNameTxBx" ValidationGroup="callValidate"
                    SetFocusOnError="true"></asp:RequiredFieldValidator>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell style="padding-top:1em;">
                <asp:Label ID="Label2" runat="server" Text="Description/Defination"></asp:Label>
            </asp:TableCell>
            <asp:TableCell style="padding-top:1em;">
                <asp:TextBox ID="DefinationTxBx" runat="server" Width="58em" Height="3em" TextMode="MultiLine" 
                        CssClass="MText"></asp:TextBox>
                <br />
                <asp:RequiredFieldValidator ID="R2" runat="server" ErrorMessage="Give a brief description of this call" 
                    ForeColor="Red" ControlToValidate="DefinationTxBx" ValidationGroup="callValidate"
                    SetFocusOnError="true"></asp:RequiredFieldValidator>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell style="padding-top:1em;">
                <asp:Label ID="Label3" runat="server" Text="Budget"></asp:Label>
            </asp:TableCell>
            <asp:TableCell style="padding-top:1em;">
                <asp:TextBox ID="BudgetTxBx" runat="server" CssClass="MText"></asp:TextBox>
                <br />
                <asp:RequiredFieldValidator ID="R3" runat="server" ErrorMessage="What is the budget for this call" 
                    ForeColor="Red" ControlToValidate="BudgetTxBx" ValidationGroup="callValidate"
                    SetFocusOnError="true"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="REV2" runat="server" ErrorMessage="Enter Correct Value"
                    ForeColor="Red" ControlToValidate="BudgetTxBx" ValidationGroup="callValidate"
                    ValidationExpression="((\d+)((\.\d{1,2})?))$" SetFocusOnError="true"></asp:RegularExpressionValidator>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell></asp:TableCell>
            <asp:TableCell style="padding-top:1em;">
                <asp:Button ID="SaveBtn" runat="server" Text="Save" ValidationGroup="callValidate" OnClick="SaveBtn_Click" />
                &nbsp;&nbsp;
                <asp:Button ID="CancelBtn" runat="server" Text="Cancel" OnClick="CancelBtn_Click" />
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    
    <asp:Label ID="error" runat="server" ForeColor="Red" Visible="false"></asp:Label>
    <br /><br />

    <asp:GridView ID="CallGridView" runat="server" DataSourceID="EntityDataSource1" AutoGenerateColumns="False" 
        DataKeyNames="RFP_id" CssClass="NewGrid" ShowFooter="true">
        <AlternatingRowStyle CssClass="NewGridAlt" />
        <Columns>
            <asp:BoundField DataField="RFP_id" HeaderText="RFP_id" ReadOnly="True" SortExpression="RFP_id" Visible="false"></asp:BoundField>
            <asp:TemplateField HeaderText="Call" SortExpression="RFP_name">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("RFP_name") %>' ID="TextBox1"
                        CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("RFP_name") %>' ID="Label1"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Description" SortExpression="RFP_description">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("RFP_description") %>' ID="TextBox2" 
                        Width="48em" Height="3em" TextMode="MultiLine" 
                        CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("RFP_description") %>' ID="Label2"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Budget" SortExpression="budget">
                <EditItemTemplate>
                    <asp:TextBox runat="server" Text='<%# Bind("budget") %>' ID="TextBox3"
                        CssClass="MText"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("budget", "{0:0,00.00}") %>' ID="Label3"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="true" ButtonType="Button" HeaderText="EDIT" />
        </Columns>

        <FooterStyle CssClass="NewGridFooter" />
    </asp:GridView>

</asp:Content>
